<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<!DOCTYPE>
<html>
<head>
    <title>添加广告</title>

    <smLink1></smLink1>
    <smLink2>
        <link rel="stylesheet" href="<%=basePath%>js/lib/uploadifive/uploadifive.css">
    </smLink2>

    <smScript1></smScript1>
    <smScript2>
        <script type="text/javascript" src="<%=basePath%>js/lib/jquery/jquery-validation/jquery.validate.min.js"></script>
        <script type="text/javascript" src="<%=basePath%>js/lib/jquery/jquery-validation/localization/messages_zh.min.js"></script>
        <script type="text/javascript" src="<%=basePath%>js/lib/uploadifive/jquery.uploadifive.min.zh_cn.js"></script>
        <script type="text/javascript" src="<%=basePath%>js/common/uploadifive.utils.js"></script>
        <script type="text/javascript" src="<%=basePath%>js/jsp/home/advert/add.js"></script>
    </smScript2>
</head>

<body>
<div id="breadcrumbs" class="breadcrumbs ace-save-state">
    <ul class="breadcrumb">
        <li>
            <a href="<%=basePath%>web/home/advert/list.html">广告列表</a>
        </li>
        <li>
            <span>添加广告</span>
        </li>
    </ul>
</div>

<div class="page-content">
    <div class="row">
        <div class="col-xs-7">
            <form id="advert_form" class="form-horizontal" role="form" method="post"
                  action="<%=basePath%>web/home/advert/add.html">
                <input name="homeAdUrl" type="hidden" value="">

                <div class="form-group">
                    <label class="col-xs-3 control-label no-padding-right" for="home_ad_name">广告标题</label>

                    <div class="col-xs-9">
                        <input id="home_ad_name" name="homeAdName" class="col-md-7" type="text" value="" placeholder="广告标题">
                    </div>
                </div>

                <div class="space-1"></div>

                <div class="form-group">
                    <label class="col-xs-3 control-label no-padding-right" for="upload_advert_img_btn">广告图片</label>

                    <div class="col-xs-9">
                        <button id="upload_advert_img_btn" class="btn btn-success btn-xs" type="button">
                            <i class="ace-icon iconfont icon-upload f-s-12"></i>上传图片
                        </button>
                    </div>
                </div>

                <div class="space-1"></div>

                <div class="form-group">
                    <label class="col-xs-3 control-label no-padding-right" for="home_ad_to_url">广告跳转URL</label>

                    <div class="col-xs-9">
                        <input id="home_ad_to_url" name="homeAdToUrl" class="col-md-7" type="text" value="" placeholder="广告跳转URL">
                    </div>
                </div>

                <div class="space-1"></div>

                <div class="form-group">
                    <label class="col-xs-3 control-label no-padding-right" for="is_show">广告是否显示</label>

                    <div class="col-xs-9">
                        <select id="is_show" name="isShow" class="col-md-7">
                            <option selected="selected" value="">请选择</option>
                            <option value="1">是</option>
                            <option value="0">否</option>
                        </select>
                    </div>
                </div>

                <div class="space-1"></div>

                <div class="clearfix form-actions">
                    <div class="col-md-offset-3 col-md-9">
                        <button name="addAdvertBtn" class="btn btn-info" type="submit">
                            <i class="ace-icon iconfont icon-plus"></i>提交
                        </button>

                        &nbsp; &nbsp; &nbsp;

                        <button class="btn" type="reset">
                            <i class="ace-icon iconfont icon-reset"></i>重置
                        </button>
                    </div>
                </div>
            </form>
        </div>

        <div class="col-xs-5">
            <div class="col-xs-12 f-s-14 red">数据校验如下：</div>

            <div class="col-xs-12">
                <div class="alert alert-warning m-0 m-t-5 p-0">
                    <ol class="validate-ol f-s-12">
                        <li>1、广告标题，必填；</li>
                        <li>2、广告图片，必上传；</li>
                        <li>3、广告跳转URL，必填；</li>
                        <li>4、广告是否显示，必选。</li>
                    </ol>
                </div>
            </div>

            <div class="col-xs-12">
                <div id="validate_container" class="display-none alert alert-danger m-0 m-t-5 p-0">
                    <ul class="validate-ul f-s-12"></ul>
                </div>
            </div>

            <div class="col-xs-12">
                <div id="advert_queue"></div>
            </div>
        </div>
    </div>
</div>
</body>
</html>